package org.springblade.tms.global.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springblade.common.enums.Enumerator;
import org.springblade.tms.global.anno.SelectEnum;

/**
 * @author yr
 * @Desc 审核类型
 * @Date 2022/3/7
 */
@Getter
@AllArgsConstructor
@SelectEnum(value = "approval", desc = "审核类型")
public enum ApprovalStatusEnum implements Enumerator {

	PENDING_SUBMISSION("pendingSubmission", "待提交"),
	PENDING_REVIEW("pendingReview", "待审核"),
	REJECTED("rejected", "已驳回"),
	PASSED("passed", "已通过");


	private final String value;
	private final String description;

	@Override
	public String value() {
		return value;
	}

	@Override
	public String description() {
		return description;
	}

	public static String getDescriptionByValue(String value) {
		for (ApprovalStatusEnum approvalStatusEnum : ApprovalStatusEnum.values()) {
			if (approvalStatusEnum.getValue().equals(value)) {
				return approvalStatusEnum.getDescription();
			}
		}
		return null;
	}
}
